package org.dulong.interceptor;

import org.springframework.aop.ThrowsAdvice;

import javax.security.auth.login.AccountException;
import java.lang.reflect.Method;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-9-23
 * Time: 下午1:31
 * To change this template use File | Settings | File Templates.
 */
public class ThrowsInterceptor implements ThrowsAdvice {
    public void afterThrowing(Method method, Object[] args, Object instence, AccountException ex) throws Throwable {
        System.out.println("方法" + method.getName() + "抛出了异常:" + ex);
    }

    public void afterThrowing(NullPointerException ex) throws Throwable {
        System.out.println("抛出了异常:" + ex);
    }
}
